﻿#include "kdpch.h"
#include "GraphicsContext.h"

#include "KuaDu/Core/Base.h"
#include "KuaDu/Renderer/Renderer.h"
#include "Platform/OpenGL/OpenGLContext.h"

namespace KD {
	Scope<GraphicsContext> GraphicsContext::Create(void* window)
	{
		switch (Renderer::GetAPI())
		{
			case RendererAPI::API::None: KD_CORE_ASSERT(false, "目前不支持此API！");
			case RendererAPI::API::OpenGL: return CreateScope<OpenGLContext>(static_cast<GLFWwindow*>(window));
		}

		KD_CORE_ASSERT(false, "未知的API！");
		return nullptr;
	}
}